﻿using System;
using UnityEngine;

namespace RootMotion
{
	// Token: 0x020000F5 RID: 245
	public class Interp
	{
		// Token: 0x060006E2 RID: 1762 RVA: 0x0003D2E4 File Offset: 0x0003B4E4
		public static float Float(float t, InterpolationMode mode)
		{
			float result;
			switch (mode)
			{
			case InterpolationMode.None:
				result = Interp.None(t, 0f, 1f);
				break;
			case InterpolationMode.InOutCubic:
				result = Interp.InOutCubic(t, 0f, 1f);
				break;
			case InterpolationMode.InOutQuintic:
				result = Interp.InOutQuintic(t, 0f, 1f);
				break;
			case InterpolationMode.InOutSine:
				result = Interp.InOutSine(t, 0f, 1f);
				break;
			case InterpolationMode.InQuintic:
				result = Interp.InQuintic(t, 0f, 1f);
				break;
			case InterpolationMode.InQuartic:
				result = Interp.InQuartic(t, 0f, 1f);
				break;
			case InterpolationMode.InCubic:
				result = Interp.InCubic(t, 0f, 1f);
				break;
			case InterpolationMode.InQuadratic:
				result = Interp.InQuadratic(t, 0f, 1f);
				break;
			case InterpolationMode.InElastic:
				result = Interp.OutElastic(t, 0f, 1f);
				break;
			case InterpolationMode.InElasticSmall:
				result = Interp.InElasticSmall(t, 0f, 1f);
				break;
			case InterpolationMode.InElasticBig:
				result = Interp.InElasticBig(t, 0f, 1f);
				break;
			case InterpolationMode.InSine:
				result = Interp.InSine(t, 0f, 1f);
				break;
			case InterpolationMode.InBack:
				result = Interp.InBack(t, 0f, 1f);
				break;
			case InterpolationMode.OutQuintic:
				result = Interp.OutQuintic(t, 0f, 1f);
				break;
			case InterpolationMode.OutQuartic:
				result = Interp.OutQuartic(t, 0f, 1f);
				break;
			case InterpolationMode.OutCubic:
				result = Interp.OutCubic(t, 0f, 1f);
				break;
			case InterpolationMode.OutInCubic:
				result = Interp.OutInCubic(t, 0f, 1f);
				break;
			case InterpolationMode.OutInQuartic:
				result = Interp.OutInCubic(t, 0f, 1f);
				break;
			case InterpolationMode.OutElastic:
				result = Interp.OutElastic(t, 0f, 1f);
				break;
			case InterpolationMode.OutElasticSmall:
				result = Interp.OutElasticSmall(t, 0f, 1f);
				break;
			case InterpolationMode.OutElasticBig:
				result = Interp.OutElasticBig(t, 0f, 1f);
				break;
			case InterpolationMode.OutSine:
				result = Interp.OutSine(t, 0f, 1f);
				break;
			case InterpolationMode.OutBack:
				result = Interp.OutBack(t, 0f, 1f);
				break;
			case InterpolationMode.OutBackCubic:
				result = Interp.OutBackCubic(t, 0f, 1f);
				break;
			case InterpolationMode.OutBackQuartic:
				result = Interp.OutBackQuartic(t, 0f, 1f);
				break;
			case InterpolationMode.BackInCubic:
				result = Interp.BackInCubic(t, 0f, 1f);
				break;
			case InterpolationMode.BackInQuartic:
				result = Interp.BackInQuartic(t, 0f, 1f);
				break;
			default:
				result = 0f;
				break;
			}
			return result;
		}

		// Token: 0x060006E3 RID: 1763 RVA: 0x0003D5D0 File Offset: 0x0003B7D0
		public static Vector3 V3(Vector3 v1, Vector3 v2, float t, InterpolationMode mode)
		{
			float num = Interp.Float(t, mode);
			return (1f - num) * v1 + num * v2;
		}

		// Token: 0x060006E4 RID: 1764 RVA: 0x0000670B File Offset: 0x0000490B
		public static float LerpValue(float value, float target, float increaseSpeed, float decreaseSpeed)
		{
			if (value == target)
			{
				return target;
			}
			if (value < target)
			{
				return Mathf.Clamp(value + Time.deltaTime * increaseSpeed, float.NegativeInfinity, target);
			}
			return Mathf.Clamp(value - Time.deltaTime * decreaseSpeed, target, float.PositiveInfinity);
		}

		// Token: 0x060006E5 RID: 1765 RVA: 0x00006746 File Offset: 0x00004946
		public static float None(float t, float b, float c)
		{
			return b + c * t;
		}

		// Token: 0x060006E6 RID: 1766 RVA: 0x0003D600 File Offset: 0x0003B800
		public static float InOutCubic(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (-2f * num2 + 3f * num);
		}

		// Token: 0x060006E7 RID: 1767 RVA: 0x0003D628 File Offset: 0x0003B828
		public static float InOutQuintic(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (6f * num2 * num + -15f * num * num + 10f * num2);
		}

		// Token: 0x060006E8 RID: 1768 RVA: 0x0003D65C File Offset: 0x0003B85C
		public static float InQuintic(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (num2 * num);
		}

		// Token: 0x060006E9 RID: 1769 RVA: 0x0003D678 File Offset: 0x0003B878
		public static float InQuartic(float t, float b, float c)
		{
			float num = t * t;
			return b + c * (num * num);
		}

		// Token: 0x060006EA RID: 1770 RVA: 0x0003D690 File Offset: 0x0003B890
		public static float InCubic(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * num2;
		}

		// Token: 0x060006EB RID: 1771 RVA: 0x0003D6AC File Offset: 0x0003B8AC
		public static float InQuadratic(float t, float b, float c)
		{
			float num = t * t;
			return b + c * num;
		}

		// Token: 0x060006EC RID: 1772 RVA: 0x0003D6C4 File Offset: 0x0003B8C4
		public static float OutQuintic(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (num2 * num + -5f * num * num + 10f * num2 + -10f * num + 5f * t);
		}

		// Token: 0x060006ED RID: 1773 RVA: 0x0003D704 File Offset: 0x0003B904
		public static float OutQuartic(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (-1f * num * num + 4f * num2 + -6f * num + 4f * t);
		}

		// Token: 0x060006EE RID: 1774 RVA: 0x0003D740 File Offset: 0x0003B940
		public static float OutCubic(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (num2 + -3f * num + 3f * t);
		}

		// Token: 0x060006EF RID: 1775 RVA: 0x0003D76C File Offset: 0x0003B96C
		public static float OutInCubic(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (4f * num2 + -6f * num + 3f * t);
		}

		// Token: 0x060006F0 RID: 1776 RVA: 0x0003D79C File Offset: 0x0003B99C
		public static float OutInQuartic(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (6f * num2 + -9f * num + 4f * t);
		}

		// Token: 0x060006F1 RID: 1777 RVA: 0x0003D7CC File Offset: 0x0003B9CC
		public static float BackInCubic(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (4f * num2 + -3f * num);
		}

		// Token: 0x060006F2 RID: 1778 RVA: 0x0003D7F4 File Offset: 0x0003B9F4
		public static float BackInQuartic(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (2f * num * num + 2f * num2 + -3f * num);
		}

		// Token: 0x060006F3 RID: 1779 RVA: 0x0003D828 File Offset: 0x0003BA28
		public static float OutBackCubic(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (4f * num2 + -9f * num + 6f * t);
		}

		// Token: 0x060006F4 RID: 1780 RVA: 0x0003D858 File Offset: 0x0003BA58
		public static float OutBackQuartic(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (-2f * num * num + 10f * num2 + -15f * num + 8f * t);
		}

		// Token: 0x060006F5 RID: 1781 RVA: 0x0003D894 File Offset: 0x0003BA94
		public static float OutElasticSmall(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (33f * num2 * num + -106f * num * num + 126f * num2 + -67f * num + 15f * t);
		}

		// Token: 0x060006F6 RID: 1782 RVA: 0x0003D8D8 File Offset: 0x0003BAD8
		public static float OutElasticBig(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (56f * num2 * num + -175f * num * num + 200f * num2 + -100f * num + 20f * t);
		}

		// Token: 0x060006F7 RID: 1783 RVA: 0x0003D91C File Offset: 0x0003BB1C
		public static float InElasticSmall(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (33f * num2 * num + -59f * num * num + 32f * num2 + -5f * num);
		}

		// Token: 0x060006F8 RID: 1784 RVA: 0x0003D958 File Offset: 0x0003BB58
		public static float InElasticBig(float t, float b, float c)
		{
			float num = t * t;
			float num2 = num * t;
			return b + c * (56f * num2 * num + -105f * num * num + 60f * num2 + -10f * num);
		}

		// Token: 0x060006F9 RID: 1785 RVA: 0x0000674D File Offset: 0x0000494D
		public static float InSine(float t, float b, float c)
		{
			c -= b;
			return -c * Mathf.Cos(t / 1f * 1.57079637f) + c + b;
		}

		// Token: 0x060006FA RID: 1786 RVA: 0x0000676D File Offset: 0x0000496D
		public static float OutSine(float t, float b, float c)
		{
			c -= b;
			return c * Mathf.Sin(t / 1f * 1.57079637f) + b;
		}

		// Token: 0x060006FB RID: 1787 RVA: 0x0000678A File Offset: 0x0000498A
		public static float InOutSine(float t, float b, float c)
		{
			c -= b;
			return -c / 2f * (Mathf.Cos(3.14159274f * t / 1f) - 1f) + b;
		}

		// Token: 0x060006FC RID: 1788 RVA: 0x0003D994 File Offset: 0x0003BB94
		public static float InElastic(float t, float b, float c)
		{
			c -= b;
			float num = 1f;
			float num2 = num * 0.3f;
			float num3 = 0f;
			if (t == 0f)
			{
				return b;
			}
			if ((t /= num) == 1f)
			{
				return b + c;
			}
			float num4;
			if (num3 == 0f || num3 < Mathf.Abs(c))
			{
				num3 = c;
				num4 = num2 / 4f;
			}
			else
			{
				num4 = num2 / 6.28318548f * Mathf.Asin(c / num3);
			}
			return -(num3 * Mathf.Pow(2f, 10f * (t -= 1f)) * Mathf.Sin((t * num - num4) * 6.28318548f / num2)) + b;
		}

		// Token: 0x060006FD RID: 1789 RVA: 0x0003DA4C File Offset: 0x0003BC4C
		public static float OutElastic(float t, float b, float c)
		{
			c -= b;
			float num = 1f;
			float num2 = num * 0.3f;
			float num3 = 0f;
			if (t == 0f)
			{
				return b;
			}
			if ((t /= num) == 1f)
			{
				return b + c;
			}
			float num4;
			if (num3 == 0f || num3 < Mathf.Abs(c))
			{
				num3 = c;
				num4 = num2 / 4f;
			}
			else
			{
				num4 = num2 / 6.28318548f * Mathf.Asin(c / num3);
			}
			return num3 * Mathf.Pow(2f, -10f * t) * Mathf.Sin((t * num - num4) * 6.28318548f / num2) + c + b;
		}

		// Token: 0x060006FE RID: 1790 RVA: 0x0003DAFC File Offset: 0x0003BCFC
		public static float InBack(float t, float b, float c)
		{
			c -= b;
			t /= 1f;
			float num = 1.70158f;
			return c * t * t * ((num + 1f) * t - num) + b;
		}

		// Token: 0x060006FF RID: 1791 RVA: 0x0003DB30 File Offset: 0x0003BD30
		public static float OutBack(float t, float b, float c)
		{
			float num = 1.70158f;
			c -= b;
			t = t / 1f - 1f;
			return c * (t * t * ((num + 1f) * t + num) + 1f) + b;
		}
	}
}
